<!--
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-04-20 19:47:52
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-04-20 20:58:00
 * @FilePath: /free-learning/src/views/course-manage/course/tour.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <el-tour v-model="openTour" :show-close="false" @finish="handleFinish">
    <el-tour-step target="#courseAdd-tour" placement="right" title="新增课程">
      <template #default>
        <p>这里可以新增课程</p>
      </template>
    </el-tour-step>
    <el-tour-step target="#courseSearchForm-tour" placement="bottom" title="搜索课程">
      <template #default>
        <p>这里可以根据课程关键字，课程状态，课程分类，开课时间搜索您的课程</p>
      </template>
    </el-tour-step>
    <el-tour-step target="#courseAuditOperate-tour" placement="right" title="审核历史">
      <template #default>
        <p>这里可以查看您的课程的审核历史</p>
      </template>
    </el-tour-step>
    <el-tour-step target="#courseChapterOperate-tour" placement="right" title="分集维护">
      <template #default>
        <p>这里可以维护您的课程的分集</p>
      </template>
    </el-tour-step>
    <el-tour-step target="#courseEditOperate-tour" placement="right" title="编辑课程">
      <template #default>
        <p>这里可以编辑您的课程</p>
      </template>
    </el-tour-step>
    <el-tour-step target="#courseDeleteOperate-tour" placement="right" title="删除课程">
      <template #default>
        <p>这里可以删除您的课程</p>
      </template>
    </el-tour-step>
    <el-tour-step target="#courseSendOperate-tour" placement="right" title="发送课程">
      <template #default>
        <p>这里可以发布和下架您的课程</p>
      </template>
    </el-tour-step>
  </el-tour>
</template>

<script setup lang="ts">
import { useUserStore } from "@/store";
import tourConfig from "@/utils/tourConfig";
const userStore = useUserStore();
defineOptions({
  name: "CourseTour",
});
const emit = defineEmits<{
  (e: "finish"): void;
}>();
const openTour = ref(false);
onMounted(() => {
  const isFirstInCourse = tourConfig.getTourConfig("isFirstInCourse");
  openTour.value =
    (isFirstInCourse === undefined ? true : isFirstInCourse) &&
    userStore.userInfo.perms.includes("sys:course:pass");
});
const handleFinish = () => {
  tourConfig.setTourConfig("isFirstInCourse", false);
  emit("finish");
};
</script>

<style scoped lang="scss"></style>
